<?php

use yii\helpers\Html;
use kartik\widgets\ActiveForm;
use kartik\widgets\DateTimePicker;

/* @var $this yii\web\View */
/* @var $model backend\module\content\models\Article */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="article-form">

    <?php
    $form = ActiveForm::begin([
                'options' => [
                    'class' => 'form-horizontal'
                ],
                'fieldConfig' => [
                    'template' => '{label}<div class="col-lg-7">{input}{hint}</div><div class="col-lg-3">{error}</div>',
                    'labelOptions' => ['class' => 'col-lg-2 control-label'],
                ]
    ]);
    ?>

    <?= $form->field($model, 'title')->textInput(['maxlength' => true]) ?>

    <?=
    $form->field($model, 'created')->widget(DateTimePicker::classname(), [
        'options' => ['placeholder' => Yii::t('common','Create Time')],
        'pluginOptions' => [
            'autoclose' => true,
            'format' => 'yyyy-mm-dd hh:ii:ss'
        ]
    ]);
    ?>
    <?= $form->field($model, 'description')->textarea(['rows' => 6]) ?>

    <?= $form->field($model, 'keywords')->textInput(['maxlength' => true]) ?>  

    <?= $form->field($model, 'url')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'content')->widget('kucha\ueditor\UEditor', []); ?>

<?php if (!Yii::$app->request->isAjax) { ?>
        <div class="form-group">
            <div class="col-lg-2"></div>
            <div class="col-lg-7"><?= Html::submitButton($model->isNewRecord ? Yii::t('common', 'Create') : Yii::t('common', 'Update'), ['class' => 'btn btn-primary']) ?></div>
        </div>
    <?php } ?>

<?php ActiveForm::end(); ?>

</div>
